<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="../templates/principal.xhtml">

    <ui:define name="content" id="content">
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>

        <p:dialog modal="true" widgetVar="statusDialog" header="Aguarde ... Processando ..." draggable="false" closable="false">
            <p:graphicImage value="/design/ajaxloadingbar.gif" />
        </p:dialog>

        <h:form id="frmRelCertificado" prependId="false">
            
                    <p:panel id="panel" header="Bem Vindo a Impressão dos Certificados Multiplo de Ações" style="text-align: center">
                        
                            <p:dataTable id="tabCertificado" widgetVar="wtabCertificado" var="certificado" value="#{relatorioCertificadoBean.certificadoList}" 
                                         paginator="true" rows="18" selection="#{relatorioCertificadoBean.selectedCertificadoCheck}"
                                         emptyMessage="Nenhum Certificado Selecionado ...">

                                <p:column selectionMode="multiple" style="width:18px"/>

                                <p:column headerText="Acionista" style="text-align: left;">
                                    <h:outputText value="#{certificado.nomCliente}" />
                                </p:column>

                            </p:dataTable>
                        
                        <br />
                      
                        <p:commandButton rendered="#{relatorioCertificadoBean.mostra}" value="Gerar Certificado" update="messages, panel, tabCertificado" actionListener="#{relatorioCertificadoBean.gerarRelatorio}" />

                        <p:commandButton rendered="#{!relatorioCertificadoBean.mostra}" value="Imprimir Certificado" update="messages, panel, tabCertificado" actionListener="#{relatorioCertificadoBean.retornaRelatorio}" onclick="submitform('#{request.contextPath}/relatorio','certificado')" />
                    </p:panel>
         </h:form>
    </ui:define>
</ui:composition>